<?php

include("../service/userService.php");

$name = $_POST["usercontent"];
$pass = $_POST["pass"];
$conpass = $_POST["conpass"];
$result = getUserByUsername($name);
$row = ConnectionManager::getInstance()->getNumRows();
if ($row <= 0 && $pass == $conpass) {
    addUser($name, md5($pass));
    Header("Location: ../admin-page/addUser.php?message=ok");
    return;
} else {
    Header("Location: ../admin-page/addUser.php?message=error");
    return;
}
?>
